<template>
	<view>
		<button @tap="getList()">确认</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				packageData: '',
				payList: {},
			}
		},

		methods: {
			//拉起转账确认页面
			getPayment(packageData) {
				wx.requestPayment({
					// "appId": this.payList.appId, //公众号ID，由商户传入
					"timeStamp": packageData.timeStamp, //时间戳，自1970年以来的秒数
					"nonceStr": packageData.nonceStr, //随机串
					"package": packageData.package,
					"signType": "RSA", //微信签名方式：
					"paySign": packageData.paySign, //微信签名 
					"success": function(res) {
						console.log(res)
					},
					"fail": function(res) {
						console.log(res);
					},
					"complete": function(res) {
						console.log(res)
					}
				})
			},


			getList() {
				this.$Request.postT('/app/wxPay/wxPayJsApiLogisticsOrder', {
					orderNumber: "2025082610004930814"
				}).then(res => {
					if (res.code == 0) {
						this.payList = res.data
						this.getPayment(this.payList)
					}
				});
			},

		},
	}
</script>

<style scoped lang="scss">
	.box {
		width: 100vw;
		height: 100vh;
	}

	.img_box {
		width: 150rpx;
		height: 150rpx;
		position: absolute;
		left: 50%;
		top: 20%;
		transform: translate(-50%, -50%);
	}

	.text_box {
		width: 100%;
		height: 5vh;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 40rpx;
		position: absolute;
		left: 50%;
		top: 30%;
		transform: translate(-50%, -50%);
	}
</style>